// 生成问卷列表
const Mock = require("mockjs");
const Random = Mock.Random;

function getQuestionList(opt = {}) {
  const { len = 10, isDeleted = false, isStar = false } = opt;
  const list = [];
  for (let i = 0; i < len; i++) {
    list.push(
      Mock.mock({
        _id: Random.id(),
        title: Random.ctitle(),
        isPublished: Random.boolean(),
        isStar: isStar ? isStar : Random.boolean(),
        answerCount: Random.natural(50, 100),
        createAt: Random.datetime(),
        isDeleted: isDeleted ? isDeleted : Random.boolean(),
      })
    );
  }
  return list;
}
module.exports = getQuestionList;
